home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / ca29_3.zip / SPRINT.CMD < prev    next >
OS/2 REXX Batch file  |  1992-10-23  |  3KB  |  70 lines

  1. S0 = 10             ; Dialing directory number we'll use
  2. ; ----- SprintNet: Connect to SprintNet
  3. ; ----------------------------------------------------------------
  4. ;    Note: This script may be used by itself (to put you at Sprint-
  5. ;    Net's "@ " prompt, or may be FCALLed by another script.  This
  6. ;    script is written to be FCALLed, executed directly (F2) or
  7. ;    attached to a dialing directory entry (for manual execution).
  8. ; ----------------------------------------------------------------
  9. ;    Note: Change the value above to reflect the dialing directory
  10. ;    entry number you have prepared.  The default is "10".
  11. ; ----------------------------------------------------------------
  12. ;    S0 is modified by this script.
  13. ; ----------------------------------------------------------------
  14. ;    Make connection to SprintNet.  The dialing directory (or current
  15. ;    .. setting define parity and speed).
  16. ;
  17.     LEGEND " Dialing SprintNet... "
  18.     IF NOT LINKED        ; If script not invoked from Alt-D
  19.        DIAL S0        ; Call dial dir entry number 10 (SprintNet)
  20.        IF FAILED EXIT    ; IF esc out, terminate script
  21.        ENDIF        ; End if not linked
  22. ;
  23. ;    Make connection according to the dialing directory's parity/speed
  24. ;    .. i.e: parity and speed make a difference in how we connect
  25. ;
  26.     PAUSE 5             ; Wait for the modem to settle
  27.     COMPARMS S0            ; Get current settings
  28.     IF STRCMP "N" S0(5:5)           ; If no parity
  29.        IF STRCMP "2400" S0(0:3)     ; If 2400 baud connect Send @D<cr>
  30.           TRANS "@"                 ;    Send @D<cr> slowly
  31.           PAUSE 1            ;    Wait a moment
  32.           TRANS "D"                 ;    Set to 8N1
  33.           PAUSE 1            ;    Wait a moment
  34.           TRANS "!"                 ;    Set to 8N1
  35.        ELSE             ; ELSE 300/1200 (send <cr>D<cr>)
  36.           TRANSMIT "!D"             ;    Transmit Carriage return <CR> D
  37.           PAUSE 1            ;    Wait 1 sec
  38.           TRANSMIT "!"              ;    .. (8 bit identifier)
  39.           ENDIF
  40.     ELSE                ; ELSE even or odd parity
  41.        IF STRCMP "2400" S0(0:3)     ; If 2400 baud connect Send @D<cr>
  42.           TRANS "@"                 ;    Send @D<cr> slowly
  43.           PAUSE 1            ;    Wait a moment
  44.           TRANS "D"                 ;    Set to 8N1
  45.           PAUSE 1            ;    Wait a moment
  46.           TRANS "!"                 ;    Set to 8N1
  47.        ELSE             ; ELSE 300/1200 (send <cr><cr>)
  48.           TRANSMIT "!"              ;    Transmit Carriage return <CR>
  49.           PAUSE 2            ;    Wait 1 sec
  50.           TRANSMIT "!"              ;    Transmit Carriage return <CR>
  51.           ENDIF
  52.        ENDIF
  53. ;
  54. ;    Send terminal identification
  55. ;
  56.     WAITFOR "TERMINAL="     ; Wait for the prompt
  57.     TRANSMIT "D1!"          ; Set terminal type
  58.     WAITFOR "@"             ; Wait for next prompt
  59. ;
  60. ;    Set a few more values
  61. ;
  62.     SET BSUPPRESS OFF    ; Turn off blank line suppression
  63.     SET MASK ON        ; Turn on high bit mask
  64.     SET CDISPLAY ON     ; Display ctl chars
  65. ;
  66. ;    Exit - this script may be called
  67. ;
  68.     IF FCALLED FRETURN    ; Return to caller if called
  69.     ALARM            ; Sound alarm - we're done
  70.